<%--
  Created by IntelliJ IDEA.
  User: 帅帅的奇奇
  Date: 2019/5/11
  Time: 17:57
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>

<html>
<head>
    <title>Title</title>
</head>
<body>
<c:forEach items="${pageUtil.list}" var="cl">
    <tr>
        <td>${cl.id}</td>
        <td>${cl.realName}</td>
        </td>
    </tr>
</c:forEach>
<script>
    layui.use('laypage', function(){
        var laypage = layui.laypage;
        laypage.render({
            elem: 'fenye'
            ,count: ${pageUtil.totalRows}
            ,limit:4//数据总数，从服务端得到
            ,curr:${pageUtil.currentPage}
            ,hash:true
            ,jump: function(obj, first){
                //obj包含了当前分页的所有参数，比如：
                console.log(obj.curr); //得到当前页，以便向服务端请求对应页的数据。
                console.log(obj.limit); //得到每页显示的条数
                //首次不执行
                if(!first){
                    window.location.href="/shop/classTypeList?page="+obj.curr+"&limit="+obj.limit;
                }
            }
        });
    });
</script>
</body>
</html>
